﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LNBMS.DAL;
using LNBMS.Entity;

namespace LNBMS.BLL
{
    public class CountyBLL
    {
        private CountyDAL _dal = new CountyDAL();

        #region 增删改查
        /// <summary>
        /// 增加一条数据
        /// </summary>
        /// <param name="entity">实体类</param>
        /// <returns></returns>
        public bool Insert(County entity)
        {
            return _dal.Insert(entity);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        /// <param name="entity">实体类</param>
        /// <returns></returns>
        public bool Update(County entity)
        {
            return _dal.Update(entity);
        }
        /// <summary>
        /// 删除一条数据
        /// </summary>
        /// <param name="KeyValue">主键</param>
        /// <returns></returns>
        public bool Delete(string KeyValue)
        {
            return _dal.Delete(KeyValue);
        }
        /// <summary>
        /// 根据一个主键得到一个实体
        /// </summary>
        /// <param name="KeyValue"></param>
        /// <returns></returns>
        public County GetEntity(string KeyValue)
        {
            return _dal.GetEntity(KeyValue);
        }
        #endregion

        /// <summary>
        /// 根据sql查找
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public List<County> GetListBySql(string query)
        {
            return new List<County>(_dal.GetListBySql(query));
        }
        /// <summary>
        /// 根据sql查找
        /// </summary>
        /// <param name="query"></param>
        /// <param name="param"></param>
        /// <returns></returns>
        public List<County> GetListBySql(string query, string[] param)
        {
            return new List<County>(_dal.GetListBySql(query, param));
        }
    }
}
